package com.briup.bms.web.controller;

import com.briup.bms.common.utils.Result;
import com.briup.bms.service.SItemService;
import com.briup.bms.web.vm.ItemVO;
import com.github.pagehelper.PageInfo;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: Paocha
 * @date: 2021-11-25-16:33
 */
@RestController
@RequestMapping("/item")
public class ItemController {
    private SItemService itemService;

    public ItemController(SItemService itemService) {
        this.itemService = itemService;
    }

    @GetMapping("/by/order")
    public Result<List<ItemVO>> getItemByOrderId(@RequestParam("orderId") Integer orderId){
        return Result.success(itemService.getItemByOrderId(orderId));

    }
}
